package cn.tedu.spring;

import cn.tedu.spring.bean.UserDao;
import cn.tedu.spring.file.Database;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;


public class TestSpringConfig {
    public static void main(String[] args) {
        ApplicationContext context=new AnnotationConfigApplicationContext(SpringConfig.class);
        // 获取UserDao
        final UserDao bean = context.getBean(UserDao.class);
        System.out.println(bean);
        // 获取databases
        final Database bean1 = context.getBean(Database.class);
        System.out.println(bean1);
    }
}
